package cn.rongdao.jrkabao.model.remind;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.bean.remind.RemindExportBillBean;
import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/12/1
 */

public class RemindExportBillModel extends BaseKaMaoModel {

    public static RemindExportBillModel getInstance() {
        return getPresent(RemindExportBillModel.class);
    }

    public void execute(boolean isUpdate, String email, Observer<RemindExportBillBean> observer) {
        addParamStrings("type", isUpdate ? "1" : "2");
        addParamStrings("email", FRString.valueOf(email));
        Observable<RemindExportBillBean> observable = mServletApi.exportBill(mParams).map(new HttpFunction<RemindExportBillBean>());
        toSubscribe(observable, observer);
    }
}
